require 'zlib'

class FlickrCrawl < ActiveRecord::Base
  belongs_to :service    # foreign key - service_id
  has_one :flickr_data, :foreign_key => :crawl_id

  def data
    self.flickr_data
  end
  
  def data=(new_data)
    self.flickr_data = new_data
  end
  
  def create_data(args = {})
    create_flickr_data args
  end
  
  #  def body
  #    Zlib::Inflate.inflate super
  #  end
  #  
  #  def body=(new_body)
  #    if new_body.nil? then
  #      super  nil
  #    else
  #      super Zlib::Deflate.deflate new_body
  #    end
  #    super
  #  end
end
